home *** CD-ROM | disk | FTP | other *** search
- TOP(1) USER COMMANDS TOP(1)
-
- NAME
-
- top - Tony's optimizer - The SOZOBON(X) optimizer
-
-
- SYNOPSIS
-
- top [options] infile [outfile]
-
- top [-Vh][-vgqaAbcfjlmpru] <infile> [<outfile>]
-
-
- DESCRIPTION
-
- Top is an assembly-code optimizer designed for use with hcc.
- It accepts as input the code generated by hcc, and generates an
- optimized form of the assembly as output. By default it works as
- a filter on <infile>, replacing the original code with the output.
- Using '-' as input file will cause top to read from stdin (and
- write to stdout).
-
- If <outfile> is given, the optimized code is written to the named
- file. Using the name '-' for the output file causes the output to
- be sent directly to stdout.
-
- Diagnostic output is send to stderr.
-
- The optimizer is normally run by the cc command, but accepts the
- following options when run manually:
-
- --version
- -V
- Print the version info to stdout and exit.
-
- -h (help)
- Print the commandline syntax and the options, and exit.
-
-
- -v (verbose)
- Print some processing information (function names).
- Display statistics about optimizations made on the
- file, and the short version information for 'top'.
-
- -g
- Don't make any changes which can confuse the debugger.
-
- -q
- Prefer generation of faster to smaller code.
-
- -a
- Convert 'jsr' labels to PC relative if they are in this
- modulue. (Default is off, this time, but jas will do
- that by default.)
-
- -A
- Always convert 'jsr' labels to PC relative. You can use this
- option if the binary is small enough, and modules are sorted,
- so that the routines are to reach with short branches.
- (not completely finished)
-
- -p
- Disable peephole optimizations.
-
- -b
- Disable conditional branch reversals.
-
- -f
- Disable function resorting.
-
- -m
- Disable register joining.
-
- -r
- Disable registerizing of variables.
-
- -l
- Disable loop rotations. Loop rotations make the code faster,
- and sometimes longer.
-
- -j
- Disable block optimizing. Block optimizing makes the binary
- shorter but not faster. To prevent making it slower use
- option '-q'.
-
- -u
- Dont't delete link/unlink code. This feature you will need only
- in functions with stack manipulations (e.g. use of alloca()).
- So inhibit deleting of link/unlink in such cases.
-
- -c
- Disable use of functions with register parameters. There are
- some functions in XDlibs with different entry points, a special
- one is used when the arguments are put in registers by top.
-
-
- All this options may be included in the source code as well, by
- hand, or with the '#pragma OPT "options"' statement in the C sorce
- code. hcc will generate lines like: ';opt -ra+u' from a
- statement like: '#pragma OPT "-ra+u"' to pass them to top.
- Unkown options will force top to exit. In verbose mode the
- detected option strings are displayed.
- Options switched off by commandline arguments cannot be reactivated
- by '#pragma' statements.
- You can prefix the options with '+' to switch them on, and
- '-' to switch them off: [{+|-}vgqaAbcfjlmpru]
-
- There is a special statement to prevent top from optimizing a
- function ';notop' , which is generated by hcc when detecting
- a statement '#pragma -TOP'.
- hcc generates some more useful lines for top and tells when
- ints are long values.
-
-
- The optimizer performs branch optimization as a minimum. The
- options above can be used to disable everything else. The
- optimizer will sometimes reverse the sense of a conditional
- branch to produce shorter code; this is disabled by the -b
- options.
-
- Data-flow analysis determines which machine registers contain
- useful data at any point in the code. This is used by other
- parts of the optimizer, but is also a likely source of bugs.
-
- If a bug is found in the optimizer, the options can be used
- together to eliminate more advanced features while still gaining
- the benefit of the more reliable (and quite useful) branch
- optimizer. Sometimes the '-u' switch is really helpfull.
-
- The register parameter feature is used for some functions especially
- changed for this. These are the string functions from std library,
- and some calculation functions (long and floating point calcs).
- The list of functions:
-
- basename() suffix()
-
- bzero() lmemcpy() lmemmove() memccpy() memchr()
- memcmp() memcpy() memicmp() memmove() memset()
- memswap() stradj() strcat() strchr() strcpy()
- strcspn() stricmp() stristr() strlen() strlwr()
- strncat() strncmp() strncpy() strnicmp() strnset()
- strpbrk() strpcpy() strpos() strrchr() strrev()
- strrpbrk() strrpos() strset() strspn() strstr()
- strtok() strtrim() strupr() subnstr() substr()
-
- lmul() lmulu() ldiv() ldivu() lrem()
- lremu()
-
- fpmul() fpdiv() fpadd() fpsub() fpcmp()
- fpneg() fpltof() fpftol()
-
-
- ENVIRONMENT
-
- If $STDERR is set, stderr file handle is 2, else it is -1
- (console device)
-
-
- COPYRIGHT
-
- top V 2.00X is part of the SOZOBONX C compiler.
-
- V2.00 Copyright (c) 1988-1992 by Sozobon, Ltd.
- for eXtended Version by C. Wempe & H. Weets
- and by J Geiger (1992-1994)
-
- BUGS
-
- Please report to
- MausNet: Volker Seebode @ AC3
- Internet: seebode@plesnik.bonsai.de
- using 'bugform.doc' from the SozobonX distrib.
-
- SEE ALSO
-
- cc(1), hcc(1)
-
-